<!DOCTYPE html>
<html lang='en'>

<head>
  <meta charset='UTF-8'>
  <meta http-equiv='X-UA-Compatible' content='IE=edge'>
  <meta name='viewport' content='width=device-width, initial-scale=1.0'>
  <title>Document</title>
  <script src='https://cdn.jsdelivr.net/npm/vue/dist/vue.js'></script>
  <style>
    .line {
      font-size: 50px;
    }
    
    .active {
      color: red;
    }
    
    .title {
      font-weight: 400;
    }
  </style>
</head>

<body>
  <div id='app'>
    <h2>{{message}}</h2>
    <h2 :class="{'active':isActive,'line':isLine}" class="title">我是文字</h2>
    <h2 :class="classes">我是文字</h2>
    <h2 :class="classArr">我是文字</h2>
    <h2 :style="{fontSize:'50px',color:currentColor}">我是文字</h2>
    <h2 :style="[baseStyles,addStyles]">我是文字</h2>
  </div>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        message: 'hello world',
        href: 'http://www.baidu.com',
        isActive: true,
        isLine: true,
        classArr: ['line', 'active'],
        currentColor: 'yellow',
        baseStyles: {
          fontSize: '60px',
          color: 'green',
          'font-weight': 400
        },
        addStyles: {
          fontSize: '90px'
        }
      },
      computed: {
        classes: function() {
          return {
            active: this.isActive,
            line: this.isLine
          }
        }
      }
    })
  </script>
</body>

</html>